package cn.sykj.car.service.impl;

import cn.sykj.car.entity.MenuOperationConfig;
import cn.sykj.car.mapper.MenuOperationConfigMapper;
import cn.sykj.car.service.IMenuOperationConfigService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 菜单-功能权限按钮配置 服务实现类
 * </p>
 *
 * @author yixu
 * @since 2020-07-18
 */
@Service
public class MenuOperationConfigServiceImpl extends ServiceImpl<MenuOperationConfigMapper, MenuOperationConfig> implements IMenuOperationConfigService {

    /**
     * 根据菜单id查单条权限信息
     *
     * @param menuId
     * @return
     */
    @Override
    public List<MenuOperationConfig> getMenuOperationConfigByMenuId(Long menuId) {

        QueryWrapper<MenuOperationConfig> mocCondition = new QueryWrapper<>();
        mocCondition.eq(MenuOperationConfig.MENU_ID,menuId);
        mocCondition.orderByAsc(MenuOperationConfig.ID);
        return this.list(mocCondition);
    }
}
